﻿@{
    ViewData["Title"] = "HTTP日志明细";
    Layout = "~/Views/Shared/_LayuiTable.cshtml";
}
<form id="searchForm" onsubmit="return false;">
    <div class="layui-input-inline">
        <input class="layui-input search_input" placeholder="请输入关键字" name="searchValue" autocomplete="off">
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">选择时间</label>
        <div class="layui-inline">
            <input type="text" id="StartTime" name="StartTime" class="layui-input" value="@DateTime.Now.AddHours(-2).ToString("yyyy-MM-dd HH:mm:ss")" lay-verify="required|datetime" placeholder="请选择开始时间" />
        </div>
        <div class="layui-inline">
            <input type="text" id="EndTime" name="EndTime" class="layui-input" value="@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")" lay-verify="required|datetime" placeholder="请选择结束时间" />
        </div>
    </div>
    <div class="layui-input-inline">
        <a class="layui-btn layui-btn-normal" onclick="tableReload()">搜索</a>
    </div>
    <div class="layui-inline">
        <button type="reset" class="layui-btn layui-btn-danger">重置</button>
    </div>
</form>
<script type="text/html" id="tableBar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">查看内容</a>
</script>
<table class="layui-table" lay-data="{url:'@ViewBag.ListUrl',height: 'full-200', method: 'post',page:true, id:'mainTable',limits: [5, 10, 20, 50, 100]}" lay-filter="demo">
    <thead>
        <tr>
            <th lay-data="{type:'numbers'}"></th>
            <th lay-data="{field:'AddHost',width:90}">客户端IP</th>
            <th lay-data="{field:'AddTime',width:180}">时间</th>
            <th lay-data="{field:'UserName',width:90}">用户名</th>
            <th lay-data="{field:'LoginName',width:90}">登录名</th>
            @*<th lay-data="{field:'ClientSN',width:180}">客户端标识</th>*@
            <th lay-data="{field:'StatusCode',width:90}">响应状态</th>
            <th lay-data="{field:'HttpMethod',width:90}">请求方法</th>
            <th lay-data="{field:'RequestPath',width:250}">请求地址</th>
            <th lay-data="{field:'RequestParam',width:150}">请求参数</th>
            <th lay-data="{field:'RunTime',width:90}">耗时</th>
            <th lay-data="{fixed: 'right', width:150, align:'center', toolbar: '#tableBar'}"></th>
        </tr>
    </thead>
</table>
<script>
    addLayuiApp("laydate");
    addLayuiUseEvent(function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#StartTime'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#EndTime'
                , type: 'datetime'
            });
    });
</script>